package satir.card;

import java.util.ArrayList;
import satir.command.AskQuestionCmd;
import satir.command.Command;
import satir.player.Player;

/**
 * The Class ActCard.
 * 
 * @version 2.0 March 2012
 * @author Antony Chan
 * 
 */
public class ActCard extends AwardSECard {
	
	/**
	 * Instantiates a new act card.
	 *
	 * @param name the name
	 * @param questions the questions
	 */
	public ActCard(String name, ArrayList<Question> questions) {
		super(name, questions);
	}
	
	/**
	 * Check the user want to use tool or not first
	 * If not, loop the questions and create a command to ask question,
	 * After that, put the command into record
	 * 
	 * @param player the player that activate this card
	 */
	@Override
	public void activateCard(Player player) {
		System.out.println("---Act Card---");
		System.out.println(name);
		boolean isUseTool = super.useMagicTool(player, "ActCard"); // ask to user magic tool card
		if (!isUseTool) {
			ArrayList<Command> record = new ArrayList<Command>();
			for(int i=0; i<questions.size(); i++){
				Command cmd = new AskQuestionCmd(questions.get(i), player);
				cmd.execute();
				record.add(cmd);
			}
			//TODO add into history record
		}
	}
}